package com.atguigu.day13.work;

import com.atguigu.day11.exer.PrintNumber;

public class Even1 extends Thread{
    private static int num;

    @Override
    public void run() {
        while (true){
            synchronized (PrintNumber.class){
                try {
                    PrintNumber.class.notify();
                    Thread.sleep(1000);
                    System.out.println(getName()+":"+ ++num);
                    PrintNumber.class.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
